import {FC } from 'react'

//引入自定义hook
import useCounter from '../自定义hook/useCounter'

let UseCustomHook:FC<any> = ()=> {
    let [count,method] = useCounter(100)
    return(
        <fieldset>
            <legend>使用自定义hook</legend>

            <button onClick={()=>{
                method.decrease(5)
            }} >-</button>
            &nbsp;&nbsp;
                <b>{count}</b>
            &nbsp;&nbsp;
            <button onClick={()=>{
                method.increase(10)
            }} >+</button>
        </fieldset>
    )
}

export default UseCustomHook
